<template>
  <div class="swapper">
    <swiper ref="mySwiper" :options="swiperOptions" v-if="list.length">
      <swiper-slide v-for="item of list" :key="item.id">
        <img
          class="swiper-img" :src="item.imgUrl" alt=""
        />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: "HomeSwiper",
  props: {
    list: Array
  },
  data: function () {
    return {
      swiperOptions: {
         pagination : '.swiper-pagination',
         loop: true,
         autoplay:false,
      }
    };
  },
};
</script>

<style scoped>
.swapper >>> .swiper-pagination-bullet-active {
    background: #fff;
}
.swapper {
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-bottom: 112.5px;
    background: #ccc;
}
.swiper-img {
  width: 100%;
  height: 100%;
}
</style>